package com.ideal.gpt.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.ideal.gpt.GptJobConfig;
import com.lzwork.web.BaseController;

/**
 * @author LiZheng
 * @date 2024年4月25日 15:29:42
 */

@Controller
@RequestMapping(value = "/server/*")
public class ServerController extends BaseController
{
	@GetMapping(value = "/refresh", produces = "application/json;charset=UTF-8")
	@ResponseBody
	public JSONObject refresh()
	{
		boolean done = GptJobConfig.reset();
		JSONObject result = new JSONObject();

		String info = done ? "Refresh Done." : "Refresh Fail.";
		result.put("content", info);

		return result;
	}
}
